﻿using System;

using System;

namespace ConsoleApp8
{
    class Program
    {
        static void Main(string[] args)
        {
            int num = 0;
            Console.ReadKey();
            for (int i = 2; i <= 100000; i++)
            {
                for (int k = 2; k <= i; k++)
                {
                    if (i % k == 0 && i != k)

                    {
                        break;
                    }
                    if (i % k == 0 && i == k)
                    {
                        Console.Write(i + " ");
                        num += 1;
                    }
                }
            }
            Console.WriteLine();
            Console.WriteLine("100,000以内共有" + num + "个质数");
            Console.ReadKey();
        }
    }
}